package com.maxd.modules.captcha.respository;


import com.maxd.modules.captcha.entity.SysCaptcha;
import com.maxd.modules.chat.entity.ChatContent;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.domain.Specification;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Repository
public interface SysCaptchaRepository extends JpaRepository<SysCaptcha, Long> {

    @Query(value = "select * from sys_captcha s where s.uuid=:uuid limit 1",nativeQuery = true)
    SysCaptcha findByUuid(String uuid);

    @Transactional
    @Modifying
    @Query(value = "delete from sys_captcha where uuid=:uuid",nativeQuery = true)
    Integer deleteSysCaptchaByUuid(String uuid);

}
